/*
 * Copyright (c) 2024 Eriptic Technologies.
 *
 * SPDX-License-Identifier: Apache-2.0 or MIT
 */

#include <stdint.h>

/*
 * Authentication with Signatures, X.509 Identified by 'x5t'
 * See RFC9529 Section 2
 * 
 * EDHOC AEAD algorithm = AES-CCM-16-64-128
 * EDHOC hash algorithm = SHA-256
 * EDHOC Message Authentication Code (MAC) length in bytes (Static DH) = 8
 * EDHOC key exchange algorithm (ECDH curve) = X25519
 * EDHOC signature algorithm = EdDSA
 * application AEAD algorithm = AES-CCM-16-64-128
 * application hash algorithm = SHA-256
 * 
 */

const uint8_t T1_RFC9529__METHOD = 0x00;
const uint8_t T1_RFC9529__SUITES_I[] = { 0x00 };
uint32_t T1_RFC9529__SUITES_I_LEN = sizeof(T1_RFC9529__SUITES_I);
const uint8_t T1_RFC9529__SUITES_R[] = { 0x00 };
uint32_t T1_RFC9529__SUITES_R_LEN = sizeof(T1_RFC9529__SUITES_R);
const uint8_t T1_RFC9529__X[] = { 0x89, 0x2e, 0xc2, 0x8e, 0x5c, 0xb6, 0x66,
				  0x91, 0x08, 0x47, 0x05, 0x39, 0x50, 0x0b,
				  0x70, 0x5e, 0x60, 0xd0, 0x08, 0xd3, 0x47,
				  0xc5, 0x81, 0x7e, 0xe9, 0xf3, 0x32, 0x7c,
				  0x8a, 0x87, 0xbb, 0x03 };
uint32_t T1_RFC9529__X_LEN = sizeof(T1_RFC9529__X);
const uint8_t T1_RFC9529__G_X[] = { 0x31, 0xf8, 0x2c, 0x7b, 0x5b, 0x9c, 0xbb,
				    0xf0, 0xf1, 0x94, 0xd9, 0x13, 0xcc, 0x12,
				    0xef, 0x15, 0x32, 0xd3, 0x28, 0xef, 0x32,
				    0x63, 0x2a, 0x48, 0x81, 0xa1, 0xc0, 0x70,
				    0x1e, 0x23, 0x7f, 0x04 };
uint32_t T1_RFC9529__G_X_LEN = sizeof(T1_RFC9529__G_X);
const uint8_t T1_RFC9529__Y[] = { 0xe6, 0x9c, 0x23, 0xfb, 0xf8, 0x1b, 0xc4,
				  0x35, 0x94, 0x24, 0x46, 0x83, 0x7f, 0xe8,
				  0x27, 0xbf, 0x20, 0x6c, 0x8f, 0xa1, 0x0a,
				  0x39, 0xdb, 0x47, 0x44, 0x9e, 0x5a, 0x81,
				  0x34, 0x21, 0xe1, 0xe8 };
uint32_t T1_RFC9529__Y_LEN = sizeof(T1_RFC9529__Y);
const uint8_t T1_RFC9529__G_Y[] = { 0xdc, 0x88, 0xd2, 0xd5, 0x1d, 0xa5, 0xed,
				    0x67, 0xfc, 0x46, 0x16, 0x35, 0x6b, 0xc8,
				    0xca, 0x74, 0xef, 0x9e, 0xbe, 0x8b, 0x38,
				    0x7e, 0x62, 0x3a, 0x36, 0x0b, 0xa4, 0x80,
				    0xb9, 0xb2, 0x9d, 0x1c };
uint32_t T1_RFC9529__G_Y_LEN = sizeof(T1_RFC9529__G_Y);
const uint8_t T1_RFC9529__C_I[] = { 0x2d };
uint32_t T1_RFC9529__C_I_LEN = sizeof(T1_RFC9529__C_I);
const uint8_t T1_RFC9529__C_R[] = { 0x18 };
uint32_t T1_RFC9529__C_R_LEN = sizeof(T1_RFC9529__C_R);

/*****/
const uint8_t T1_RFC9529__SK_I[] = { 0x4c, 0x5b, 0x25, 0x87, 0x8f, 0x50, 0x7c,
				     0x6b, 0x9d, 0xae, 0x68, 0xfb, 0xd4, 0xfd,
				     0x3f, 0xf9, 0x97, 0x53, 0x3d, 0xb0, 0xaf,
				     0x00, 0xb2, 0x5d, 0x32, 0x4e, 0xa2, 0x8e,
				     0x6c, 0x21, 0x3b, 0xc8 };
uint32_t T1_RFC9529__SK_I_LEN = sizeof(T1_RFC9529__SK_I);
const uint8_t T1_RFC9529__PK_I[] = { 0xed, 0x06, 0xa8, 0xae, 0x61, 0xa8, 0x29,
				     0xba, 0x5f, 0xa5, 0x45, 0x25, 0xc9, 0xd0,
				     0x7f, 0x48, 0xdd, 0x44, 0xa3, 0x02, 0xf4,
				     0x3e, 0x0f, 0x23, 0xd8, 0xcc, 0x20, 0xb7,
				     0x30, 0x85, 0x14, 0x1e };
uint32_t T1_RFC9529__PK_I_LEN = sizeof(T1_RFC9529__PK_I);

/*****/
const uint8_t T1_RFC9529__SK_R[] = { 0xef, 0x14, 0x0f, 0xf9, 0x00, 0xb0, 0xab,
				     0x03, 0xf0, 0xc0, 0x8d, 0x87, 0x9c, 0xbb,
				     0xd4, 0xb3, 0x1e, 0xa7, 0x1e, 0x6e, 0x7e,
				     0xe7, 0xff, 0xcb, 0x7e, 0x79, 0x55, 0x77,
				     0x7a, 0x33, 0x27, 0x99 };
uint32_t T1_RFC9529__SK_R_LEN = sizeof(T1_RFC9529__SK_R);
const uint8_t T1_RFC9529__PK_R[] = { 0xa1, 0xdb, 0x47, 0xb9, 0x51, 0x84, 0x85,
				     0x4a, 0xd1, 0x2a, 0x0c, 0x1a, 0x35, 0x4e,
				     0x41, 0x8a, 0xac, 0xe3, 0x3a, 0xa0, 0xf2,
				     0xc6, 0x62, 0xc0, 0x0b, 0x3a, 0xc5, 0x5d,
				     0xe9, 0x2f, 0x93, 0x59 };
uint32_t T1_RFC9529__PK_R_LEN = sizeof(T1_RFC9529__PK_R);
/****/

const uint8_t T1_RFC9529__ID_CRED_R[] = { 0xa1, 0x18, 0x22, 0x82, 0x2e,
					  0x48, 0x79, 0xf2, 0xa4, 0x1b,
					  0x51, 0x0c, 0x1f, 0x9b };
uint32_t T1_RFC9529__ID_CRED_R_LEN = sizeof(T1_RFC9529__ID_CRED_R);
const uint8_t T1_RFC9529__CRED_R[] = {
	0x58, 0xf1, 0x30, 0x81, 0xee, 0x30, 0x81, 0xa1, 0xa0, 0x03, 0x02, 0x01,
	0x02, 0x02, 0x04, 0x62, 0x31, 0x9e, 0xc4, 0x30, 0x05, 0x06, 0x03, 0x2b,
	0x65, 0x70, 0x30, 0x1d, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04,
	0x03, 0x0c, 0x12, 0x45, 0x44, 0x48, 0x4f, 0x43, 0x20, 0x52, 0x6f, 0x6f,
	0x74, 0x20, 0x45, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x30, 0x1e, 0x17,
	0x0d, 0x32, 0x32, 0x30, 0x33, 0x31, 0x36, 0x30, 0x38, 0x32, 0x34, 0x33,
	0x36, 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33,
	0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06,
	0x03, 0x55, 0x04, 0x03, 0x0c, 0x17, 0x45, 0x44, 0x48, 0x4f, 0x43, 0x20,
	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x45, 0x64,
	0x32, 0x35, 0x35, 0x31, 0x39, 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b,
	0x65, 0x70, 0x03, 0x21, 0x00, 0xa1, 0xdb, 0x47, 0xb9, 0x51, 0x84, 0x85,
	0x4a, 0xd1, 0x2a, 0x0c, 0x1a, 0x35, 0x4e, 0x41, 0x8a, 0xac, 0xe3, 0x3a,
	0xa0, 0xf2, 0xc6, 0x62, 0xc0, 0x0b, 0x3a, 0xc5, 0x5d, 0xe9, 0x2f, 0x93,
	0x59, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0xb7,
	0x23, 0xbc, 0x01, 0xea, 0xb0, 0x92, 0x8e, 0x8b, 0x2b, 0x6c, 0x98, 0xde,
	0x19, 0xcc, 0x38, 0x23, 0xd4, 0x6e, 0x7d, 0x69, 0x87, 0xb0, 0x32, 0x47,
	0x8f, 0xec, 0xfa, 0xf1, 0x45, 0x37, 0xa1, 0xaf, 0x14, 0xcc, 0x8b, 0xe8,
	0x29, 0xc6, 0xb7, 0x30, 0x44, 0x10, 0x18, 0x37, 0xeb, 0x4a, 0xbc, 0x94,
	0x95, 0x65, 0xd8, 0x6d, 0xce, 0x51, 0xcf, 0xae, 0x52, 0xab, 0x82, 0xc1,
	0x52, 0xcb, 0x02
};
uint32_t T1_RFC9529__CRED_R_LEN = sizeof(T1_RFC9529__CRED_R);
const uint8_t T1_RFC9529__ID_CRED_I[] = { 0xa1, 0x18, 0x22, 0x82, 0x2e,
					  0x48, 0xc2, 0x4a, 0xb2, 0xfd,
					  0x76, 0x43, 0xc7, 0x9f };
uint32_t T1_RFC9529__ID_CRED_I_LEN = sizeof(T1_RFC9529__ID_CRED_I);
const uint8_t T1_RFC9529__CRED_I[] = {
	0x58, 0xf1, 0x30, 0x81, 0xee, 0x30, 0x81, 0xa1, 0xa0, 0x03, 0x02, 0x01,
	0x02, 0x02, 0x04, 0x62, 0x31, 0x9e, 0xa0, 0x30, 0x05, 0x06, 0x03, 0x2b,
	0x65, 0x70, 0x30, 0x1d, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04,
	0x03, 0x0c, 0x12, 0x45, 0x44, 0x48, 0x4f, 0x43, 0x20, 0x52, 0x6f, 0x6f,
	0x74, 0x20, 0x45, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x30, 0x1e, 0x17,
	0x0d, 0x32, 0x32, 0x30, 0x33, 0x31, 0x36, 0x30, 0x38, 0x32, 0x34, 0x30,
	0x30, 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33,
	0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06,
	0x03, 0x55, 0x04, 0x03, 0x0c, 0x17, 0x45, 0x44, 0x48, 0x4f, 0x43, 0x20,
	0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x45, 0x64,
	0x32, 0x35, 0x35, 0x31, 0x39, 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b,
	0x65, 0x70, 0x03, 0x21, 0x00, 0xed, 0x06, 0xa8, 0xae, 0x61, 0xa8, 0x29,
	0xba, 0x5f, 0xa5, 0x45, 0x25, 0xc9, 0xd0, 0x7f, 0x48, 0xdd, 0x44, 0xa3,
	0x02, 0xf4, 0x3e, 0x0f, 0x23, 0xd8, 0xcc, 0x20, 0xb7, 0x30, 0x85, 0x14,
	0x1e, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0x52,
	0x12, 0x41, 0xd8, 0xb3, 0xa7, 0x70, 0x99, 0x6b, 0xcf, 0xc9, 0xb9, 0xea,
	0xd4, 0xe7, 0xe0, 0xa1, 0xc0, 0xdb, 0x35, 0x3a, 0x3b, 0xdf, 0x29, 0x10,
	0xb3, 0x92, 0x75, 0xae, 0x48, 0xb7, 0x56, 0x01, 0x59, 0x81, 0x85, 0x0d,
	0x27, 0xdb, 0x67, 0x34, 0xe3, 0x7f, 0x67, 0x21, 0x22, 0x67, 0xdd, 0x05,
	0xee, 0xff, 0x27, 0xb9, 0xe7, 0xa8, 0x13, 0xfa, 0x57, 0x4b, 0x72, 0xa0,
	0x0b, 0x43, 0x0b
};
uint32_t T1_RFC9529__CRED_I_LEN = sizeof(T1_RFC9529__CRED_I);

const uint8_t T1_RFC9529__MESSAGE_1[] = {
	0x00, 0x00, 0x58, 0x20, 0x31, 0xf8, 0x2c, 0x7b, 0x5b, 0x9c,
	0xbb, 0xf0, 0xf1, 0x94, 0xd9, 0x13, 0xcc, 0x12, 0xef, 0x15,
	0x32, 0xd3, 0x28, 0xef, 0x32, 0x63, 0x2a, 0x48, 0x81, 0xa1,
	0xc0, 0x70, 0x1e, 0x23, 0x7f, 0x04, 0x2d
};
uint32_t T1_RFC9529__MESSAGE_1_LEN = sizeof(T1_RFC9529__MESSAGE_1);

const uint8_t T1_RFC9529__MESSAGE_2[] = {
	0x58, 0x72, 0xdc, 0x88, 0xd2, 0xd5, 0x1d, 0xa5, 0xed, 0x67, 0xfc, 0x46,
	0x16, 0x35, 0x6b, 0xc8, 0xca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 0x97, 0x04, 0x66, 0xdc, 0xb7,
	0x1f, 0x76, 0x74, 0x5d, 0x39, 0xd3, 0x02, 0x5e, 0x77, 0x03, 0xe0, 0xc0,
	0x32, 0xeb, 0xad, 0x51, 0x94, 0x7c
};
uint32_t T1_RFC9529__MESSAGE_3_LEN = sizeof(T1_RFC9529__MESSAGE_3);

const uint8_t T1_RFC9529__MESSAGE_4[] = { 0x48, 0x4f, 0x0e, 0xde, 0xe3,
					  0x66, 0xe5, 0xc8, 0x83 };
uint32_t T1_RFC9529__MESSAGE_4_LEN = sizeof(T1_RFC9529__MESSAGE_4);

const uint8_t T1_RFC9529__PRK_out[] = {
	0xb7, 0x44, 0xcb, 0x7d, 0x8a, 0x87, 0xcc, 0x04, 0x47, 0xc3, 0x35,
	0x0e, 0x16, 0x5b, 0x25, 0x0d, 0xab, 0x12, 0xec, 0x45, 0x33, 0x25,
	0xab, 0xb9, 0x22, 0xb3, 0x03, 0x07, 0xe5, 0xc3, 0x68, 0xf0
};

uint32_t T1_RFC9529__PRK_out_LEN = sizeof(T1_RFC9529__PRK_out);